(0) Obligation:

Clauses:

ordered([]).
ordered(.(X1, [])).
ordered(.(X, .(Y, Xs))) :- ','(less(X, s(Y)), ordered(.(Y, Xs))).
less(0, s(X2)).
less(s(X), s(Y)) :- less(X, Y).

Query: ordered(g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

lessA(0, s(T30)).
lessA(s(T35), s(T36)) :- lessA(T35, T36).
orderedB([]).
orderedB(.(T3, [])).
orderedB(.(0, .(T15, T10))) :- orderedB(.(T15, T10)).
orderedB(.(s(T20), .(T21, T10))) :- lessA(T20, T21).
orderedB(.(s(T20), .(T21, T10))) :- ','(lessA(T20, T21), orderedB(.(T21, T10))).

Query: orderedB(g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
orderedB_in: (b)
lessA_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(0, .(T15, T10))) → U2_G(T15, T10, orderedB_in_g(.(T15, T10)))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))
ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T20, T21, T10, lessA_in_gg(T20, T21))
ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → LESSA_IN_GG(T20, T21)
LESSA_IN_GG(s(T35), s(T36)) → U1_GG(T35, T36, lessA_in_gg(T35, T36))
LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_G(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → ORDEREDB_IN_G(.(T21, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDEREDB_IN_G(x1)  =  ORDEREDB_IN_G(x1)
U2_G(x1, x2, x3)  =  U2_G(x3)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)
LESSA_IN_GG(x1, x2)  =  LESSA_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(0, .(T15, T10))) → U2_G(T15, T10, orderedB_in_g(.(T15, T10)))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))
ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T20, T21, T10, lessA_in_gg(T20, T21))
ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → LESSA_IN_GG(T20, T21)
LESSA_IN_GG(s(T35), s(T36)) → U1_GG(T35, T36, lessA_in_gg(T35, T36))
LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_G(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → ORDEREDB_IN_G(.(T21, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDEREDB_IN_G(x1)  =  ORDEREDB_IN_G(x1)
U2_G(x1, x2, x3)  =  U2_G(x3)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)
LESSA_IN_GG(x1, x2)  =  LESSA_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x3)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 4 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
LESSA_IN_GG(x1, x2)  =  LESSA_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LESSA_IN_GG(s(T35), s(T36)) → LESSA_IN_GG(T35, T36)
    The graph contains the following edges 1 > 1, 2 > 2

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T20, T21, T10, lessA_in_gg(T20, T21))
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → ORDEREDB_IN_G(.(T21, T10))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))

The TRS R consists of the following rules:

orderedB_in_g([]) → orderedB_out_g([])
orderedB_in_g(.(T3, [])) → orderedB_out_g(.(T3, []))
orderedB_in_g(.(0, .(T15, T10))) → U2_g(T15, T10, orderedB_in_g(.(T15, T10)))
orderedB_in_g(.(s(T20), .(T21, T10))) → U3_g(T20, T21, T10, lessA_in_gg(T20, T21))
lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → orderedB_out_g(.(s(T20), .(T21, T10)))
U3_g(T20, T21, T10, lessA_out_gg(T20, T21)) → U4_g(T20, T21, T10, orderedB_in_g(.(T21, T10)))
U4_g(T20, T21, T10, orderedB_out_g(.(T21, T10))) → orderedB_out_g(.(s(T20), .(T21, T10)))
U2_g(T15, T10, orderedB_out_g(.(T15, T10))) → orderedB_out_g(.(0, .(T15, T10)))

The argument filtering Pi contains the following mapping:
orderedB_in_g(x1)  =  orderedB_in_g(x1)
[]  =  []
orderedB_out_g(x1)  =  orderedB_out_g
.(x1, x2)  =  .(x1, x2)
0  =  0
U2_g(x1, x2, x3)  =  U2_g(x3)
s(x1)  =  s(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x2, x3, x4)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
ORDEREDB_IN_G(x1)  =  ORDEREDB_IN_G(x1)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)

We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T20, T21, T10, lessA_in_gg(T20, T21))
U3_G(T20, T21, T10, lessA_out_gg(T20, T21)) → ORDEREDB_IN_G(.(T21, T10))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))

The TRS R consists of the following rules:

lessA_in_gg(0, s(T30)) → lessA_out_gg(0, s(T30))
lessA_in_gg(s(T35), s(T36)) → U1_gg(T35, T36, lessA_in_gg(T35, T36))
U1_gg(T35, T36, lessA_out_gg(T35, T36)) → lessA_out_gg(s(T35), s(T36))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
lessA_in_gg(x1, x2)  =  lessA_in_gg(x1, x2)
lessA_out_gg(x1, x2)  =  lessA_out_gg
U1_gg(x1, x2, x3)  =  U1_gg(x3)
ORDEREDB_IN_G(x1)  =  ORDEREDB_IN_G(x1)
U3_G(x1, x2, x3, x4)  =  U3_G(x2, x3, x4)

We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T21, T10, lessA_in_gg(T20, T21))
U3_G(T21, T10, lessA_out_gg) → ORDEREDB_IN_G(.(T21, T10))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))

The TRS R consists of the following rules:

lessA_in_gg(0, s(T30)) → lessA_out_gg
lessA_in_gg(s(T35), s(T36)) → U1_gg(lessA_in_gg(T35, T36))
U1_gg(lessA_out_gg) → lessA_out_gg

The set Q consists of the following terms:

lessA_in_gg(x0, x1)
U1_gg(x0)

We have to consider all (P,Q,R)-chains.

(21) UsableRulesReductionPairsProof (EQUIVALENT transformation)

By using the usable rules with reduction pair processor [LPAR04] with a polynomial ordering [POLO], all dependency pairs and the corresponding usable rules [FROCOS05] can be oriented non-strictly. All non-usable rules are removed, and those dependency pairs and usable rules that have been oriented strictly or contain non-usable symbols in their left-hand side are removed as well.

The following dependency pairs can be deleted:

ORDEREDB_IN_G(.(s(T20), .(T21, T10))) → U3_G(T21, T10, lessA_in_gg(T20, T21))
U3_G(T21, T10, lessA_out_gg) → ORDEREDB_IN_G(.(T21, T10))
ORDEREDB_IN_G(.(0, .(T15, T10))) → ORDEREDB_IN_G(.(T15, T10))
The following rules are removed from R:

lessA_in_gg(0, s(T30)) → lessA_out_gg
lessA_in_gg(s(T35), s(T36)) → U1_gg(lessA_in_gg(T35, T36))
U1_gg(lessA_out_gg) → lessA_out_gg
Used ordering: POLO with Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2·x1 + 2·x2   
POL(0) = 1   
POL(ORDEREDB_IN_G(x1)) = x1   
POL(U1_gg(x1)) = 2·x1   
POL(U3_G(x1, x2, x3)) = 2·x1 + 2·x2 + x3   
POL(lessA_in_gg(x1, x2)) = x1 + 2·x2   
POL(lessA_out_gg) = 1   
POL(s(x1)) = 2·x1   

(22) Obligation:

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

lessA_in_gg(x0, x1)
U1_gg(x0)

We have to consider all (P,Q,R)-chains.

(23) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(24) YES